package cn.edu.tju.scs.leave.web;

import cn.edu.tju.scs.leave.dto.BizCode;
import cn.edu.tju.scs.leave.dto.ResponseCode;
import cn.edu.tju.scs.leave.entity.Menu;
import cn.edu.tju.scs.leave.service.MenuService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import java.lang.reflect.Method;
import java.util.List;

/**
 * Created by haoxiaotian on 2016/9/4 20:23.
 */
@Controller
@RequestMapping("/menus")
public class MenuController extends BaseController{

    @Autowired
    private MenuService menuService;

    @RequestMapping(method = RequestMethod.GET)
    public @ResponseBody ResponseCode<List<Menu>> queryAll(){
        return new ResponseCode<List<Menu>>(BizCode.SUCCESS,menuService.queryMenusByUserId(1));
    }
}
